-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Issues with Modal and Image Cropper position #5367
fix: Issues with Modal and Image Cropper position #5367
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/jwdz7zmdy |
app/components/modals/modal-base.js
Outdated
if (this.noCropper) { | ||
$element.modal({ | ||
centered: false | ||
}).modal('show'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will ignore all the settings done in the modal below. As evident by the dark dimmer in the modal. Make this change in the settings below
@@ -16,6 +16,7 @@ export default class SessionNotifyModal extends ModalBase { | |||
|
|||
constructor() { | |||
super(...arguments); | |||
this.noCropper = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass this as a prop rather than setting here
@iamareebjamal thank you for your reviews. i am working on changes suggested by you. |
Like my review explained why changing it this way is not good enough, @mariobehling has said Thank you!
|
@iamareebjamal i try to make changes to settings in willInitSemantic(settings){...} function. |
@iamareebjamal can i assign all properties here.
|
It should have the same interface of settings, but if it is not working, you can try that |
@iamareebjamal please have a look at this. changes
I have tested all modals and croppers mentioned above from all scroll positions and get modal at center. screenshots |
fix-all-modals-crpper chore(deps-dev): bump @sentry/tracing from 5.27.0 to 5.27.1 (fossasia#5372) Bumps [@sentry/tracing](https://github.com/getsentry/sentry-javascript) from 5.27.0 to 5.27.1. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](getsentry/sentry-javascript@5.27.0...5.27.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> chore(deps-dev): bump mini-css-extract-plugin from 1.1.2 to 1.2.0 (fossasia#5371) Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 1.1.2 to 1.2.0. - [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases) - [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md) - [Commits](webpack-contrib/mini-css-extract-plugin@v1.1.2...v1.2.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
48455af
to
a9805f1
Compare
app/components/modals/modal-base.js
Outdated
classNameBindings : ['isFullScreen:fullscreen', 'isSmall:small', 'isLarge:large'], | ||
|
||
openObserver: observer('isOpen', function() { | ||
const $element = $(this.element); | ||
if (this.isOpen) { | ||
$element.modal('show'); | ||
$element.modal({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied code. Move to a single function
app/components/modals/modal-base.js
Outdated
@@ -91,7 +129,44 @@ export default UiModal.extend({ | |||
|
|||
didInitSemantic() { | |||
if (this.isOpen) { | |||
$(this.element).modal('show'); | |||
$(this.element).modal({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate code. Remove any duplicate code
@@ -1,3 +1,4 @@ | |||
<i class="black close icon"></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a closable icon in the modal I believe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamareebjamal not present earlier. please see #4505
… into align-sessions-notify-modal-fossasia#4837
408c731
to
0833e7d
Compare
@iamareebjamal please have a look at this PR. i have removed Duplicacy of code. |
app/components/modals/modal-base.js
Outdated
classNameBindings : ['isFullScreen:fullscreen', 'isSmall:small', 'isLarge:large'], | ||
|
||
openObserver: observer('isOpen', function() { | ||
const $element = $(this.element); | ||
if (this.isOpen) { | ||
$element.modal('show'); | ||
$element.modal({...this.defaultOptions}).modal('show'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$element.modal({...this.defaultOptions}).modal('show'); | |
$element.modal(this.defaultOptions).modal('show'); |
app/components/modals/modal-base.js
Outdated
assign(settings, options); | ||
}, | ||
|
||
didInitSemantic() { | ||
if (this.isOpen) { | ||
$(this.element).modal('show'); | ||
$(this.element).modal({...this.defaultOptions}).modal('show'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$(this.element).modal({...this.defaultOptions}).modal('show'); | |
$(this.element).modal(this.defaultOptions).modal('show'); |
Since now you're only using the default options of the modal, what's the need for passing them in the |
@iamareebjamal sir i have tried this but modal is not appearing at center. All properties are present in settiings of modal but centered: false is not present in settings. For this centered: false property i have used defaultOptions object and pass it here. I think this is because the settings of semantic ui modal not contain centered as property. This is why i have make defaultOptions object in init() function and use this object in $(this.element).modal(defaultOptions).modal('show'). $(this.element).modal('show') is not working. i have done all changes suggested by you. have a look at this. |
Checking |
I think your styles are being overriden in a media query |
When the screen is smaller in height than 825px, semantic adds |
Codecov Report
@@ Coverage Diff @@
## development #5367 +/- ##
===============================================
- Coverage 22.78% 22.72% -0.06%
===============================================
Files 491 491
Lines 5245 5245
Branches 37 37
===============================================
- Hits 1195 1192 -3
- Misses 4045 4048 +3
Partials 5 5
Continue to review full report at Codecov.
|
Thanks a lot for solving a complex and long standing issue with little code changes elegantly |
@iamareebjamal my pleasure sir |
Fixes #4837, #4917, #4716, #4505, #5308
Short description of what this resolves:
this PR can solve issue #5308 #4917 #4837 #4716 #4505 .
changes
I have tested all modals and croppers mentioned above from all scroll positions and get modal at center.
Checklist
development
branch.screenshots
#4505
#4716
#4837 #5308
#4917